<script setup lang='ts'>
import { ref, reactive } from 'vue'
import { useComponents } from '../../stores/counter'//使用pina,完成撤销操作
import { storeToRefs } from 'pinia';
import { ElMessage } from 'element-plus'
import {UseLoca} from '@/hooks/UserLocaStorage.ts'
const { canvasComponents } = storeToRefs(useComponents())
const {UseDel}=UseLoca()

let CHEXIAOLOVE = () => {
  //  canvasComponents.value.pop()
  if (canvasComponents) {
    console.log(canvasComponents, "发得到妹妹");
    canvasComponents.value.pop()
    UseDel()
    ElMessage({
      showClose: true,
      message: '撤回成功。。。',
      type: 'success',
    })

    // eslint-disable-next-line no-empty
  } else {

  }
}         
</script>

<template>
  <div class="csn" @click="CHEXIAOLOVE">撤销</div>
</template>

<style lang='scss' scoped>
.csn {
  font-size: 16px;
}
</style>